# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kget
pkgver=20.04.3
pkgrel=0
# ppc64le and s390x blocked by plasma-workspace -> libksysguard -> qt5-qtwebengine
# armhf blocked by extra-cmake-modules
# mips blocked by libktorrent
arch="all !ppc64le !s390x !armhf !mips !mips64"
url="https://kde.org/applications/internet/org.kde.kget"
pkgdesc="A versatile and user-friendly download manager"
license="GPL-2.0-or-later AND LGPL-2.0-only AND GFDL-1.2-only"
makedepends="extra-cmake-modules qt5-qtbase-dev kcompletion-dev kconfig-dev kconfigwidgets-dev kcoreaddons-dev kcrash-dev kdbusaddons-dev kdoctools-dev ki18n-dev kiconthemes-dev kitemviews-dev kcmutils-dev kio-dev knotifications-dev knotifyconfig-dev kparts-dev kservice-dev ktextwidgets-dev kwallet-dev kwidgetsaddons-dev kwindowsystem-dev kxmlgui-dev kitemmodels-dev kdelibs4support-dev plasma-workspace-dev sqlite-dev qca-dev gpgme-dev libktorrent-dev libmms-dev"
source="https://download.kde.org/stable/release-service/$pkgver/src/kget-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No tests

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="55223e8e32392ea46dd50d90e532119fe8908641c6e49a29e62bd2f6a67db29940efc5e6344089c9e090810e9319399ce3dbdde61bb93f737591df03bfdf7f33  kget-20.04.3.tar.xz"
